public class Test03 {
    public ListNode Merge (ListNode pHead1, ListNode pHead2) {
        ListNode dummy = new ListNode(0);
        ListNode tail = dummy;
        while(pHead1 != null && pHead2 != null){
            if(pHead1.val <= pHead2.val){
                ListNode tmp = pHead1.next;
                tail.next = pHead1;
                pHead1 = tmp;
                tail = tail.next;
            }else{
                ListNode tmp = pHead2.next;
                tail.next = pHead2;
                pHead2 = tmp;
                tail = tail.next;
            }
        }
        tail.next = pHead1 != null ? pHead1: pHead2;
        return dummy.next;
    }
}
